// 比较两个对象中的key所对应的值是否相等
export const compare = <
  T extends object,
  U extends object,
  K extends keyof T & keyof U
>(
  obj1: T,
  obj2: U,
  keys: K[]
): boolean => {
  return !keys.some(key => obj1[key] !== (obj2[key] as T[K] & U[K]));
};
